<view class="list">
    <block wx:for="{{obj.orderGoods}}" wx:key="{{index}}">
        <view class="item" wx:if='{{item.promotionType!==9}}'>
            <image wx:if="{{item.imagePath}}" src="{{item.imagePath}}"></image>
            <image wx:else src="{{imageUrl}}/xiaomai.jpg"></image>
            <view class="info">
                <view>{{item.goodsName}}</view>
                <view class="pre_price">￥ {{util.formatNum(item.originalPrice)}}</view>
            </view>
            <view class="num">x {{item.num}}</view>
        </view>
        <view class="group_item" wx:else>
            <view class="group_text">
                <image src='{{imageUrl}}/group_image.png'></image>
                <text class="group-name">{{item.promotionAlias}}</text>
                <text class="num">数量: {{item.num}}</text>
            </view>
            <view class="item" wx:key="{{idx}}" wx:for="{{item.goodsList}}" wx:for-index="idx" wx:for-item="goodsList">
                <image wx:if="{{goodsList.imagePath}}" src="{{goodsList.imagePath}}"></image>
                <image wx:else src="{{imageUrl}}/xiaomai.jpg"></image>
                <view class="info">
                    <view>{{goodsList.goodsName}}</view>
                    <view class="pre_price">￥ {{util.formatNum(goodsList.originalPrice)}}</view>
                </view>
            </view>
        </view>
    </block>
</view>


<template name="my_toast">
    <view class="my_toast">{{my_toast_tip}}</view>
</template>
<template name="my_pop">
    <view class="popUp">
        <image class='header' src="{{imageUrl}}/voucher_{{type}}.png"></image>
        <view class="container">
            <view class="couponlist">
                <view class="couponItem" wx:for="{{obj}}">
                    <view class="left">
                        <view>{{util.formatNum(item.presentAmount)}}</view>
                        <view>元</view>
                    </view>
                    <view class="right">
                        <view>{{item.name}}</view>
                        <view wx:if="{{item.type=='meet_reduce'}}">满{{util.formatNum(item.billAmountCondition)}}元减{{util.formatNum(item.presentAmount)}}元</view>
                        <view wx:if="{{item.type=='exclusive'}}">无限制</view>
                    </view>
                </view>
            </view>
            <view class="check" bindtap="go" data-type="{{type}}">点击去
                <text>{{type=="daily"?'领券中心':'我的优惠券'}}</text>{{type=="daily"?'领取':'查看'}}</view>
        </view>
        <image class="bottom" src="{{imageUrl}}/voucher_bottom.png"></image>
        <image bindtap='closePop' class="close" src="{{imageUrl}}/fresher-delete.png"></image>
    </view>
</template>


<wxs module="util">
    var formatNum=function(n){ 
        return Number(n) 
    } 
    module.exports = { formatNum : formatNum, }
</wxs>